<?php include 'header.php'; ?>

<style>
        
    .contenedorBlog {
        float:left;
        color:black;
        margin-top:10px;
        text-align:center;
        margin-bottom:215px;
    }
    
    .contenedorNoticiaBlog {
        float:left;
        /*margin:.8%;*/
        width:100%;
        height:auto;
        padding:5px 0 5px 15px;
        margin:0;
        border-bottom:silver solid 1px;
        border-radius:0;
        
        -webkit-transition-property: background;
        -webkit-transition-duration: .3s;
        -webkit-transition-timing-function: ease;
        -moz-transition-property: background;
        -moz-transition-duration: .3s;
        -moz-transition-timing-function: ease;
        
    }
    
    .contenedorNoticiaBlog:hover {
        background-color: #eff1ff;
        /*cursor:pointer;*/
        /*border: #5789ad solid 1px;*/
    }
    .imagenBlog {
        float:left;
        width:100%;
        height:auto;
    }
    
    .by {
        text-align:left;
        font-size:13px;
        padding-top:7px;
        width:200px;
    }
    .resumen {
        float:left;
        width:400px;
        font-size:13px;
    }
    
    a.titular {
        float:left;
        margin-top:10px;
        width:200px;
        font-weight:bold;
        border-radius:13px;
        color:black;
        font-size:15px;
        -webkit-transition-property: color;
        -webkit-transition-duration: .3s;
        -webkit-transition-timing-function: ease;
        -moz-transition-property: color;
        -moz-transition-duration: .3s;
        -moz-transition-timing-function: ease;
    }
    
    a.titular:hover {
        color:#5789ae;
        text-decoration:none;
    }
    
    .blog {
        font-weight:bold;
        background-color:#5789ad;
        color:white;
        font-size:20px;
        text-align:center;
        float:left;
        width:100%;
    }
    
    .contenedorImgBlog {
        float:left;
        width:50px;
        height:50px;
        overflow:hidden;
        padding:2px;
        box-shadow: none;
        /*border-radius:5px;*/
/*        background-color:white;
        padding:2px;
        border:silver solid 1px;*/
        /*box-shadow: 2px 2px 10px #888888;*/
    }
    
     .remove {
            cursor:pointer;
            -webkit-transition-property: color;
            -webkit-transition-duration: .3s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: color;
            -moz-transition-duration: .3s;
            -moz-transition-timing-function: ease;
        }

        .search {
            cursor:pointer;
            -webkit-transition-property: color;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: color;
            -moz-transition-duration: .5s;
            -moz-transition-timing-function: ease;
        }

        .pencil {
            cursor:pointer;
            -webkit-transition-property: color;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: color;
            -moz-transition-duration: .5s;
            -moz-transition-timing-function: ease;
        }
        .remove:hover {
            color:red;
        }

        .search:hover {
            color:blue;
        }

        .pencil:hover {
            color:green;
        }

        .opcion {
            float:right;padding:5px 5px 5px 5px;margin:2px;

            -webkit-transition-property: border;
            -webkit-transition-duration: .5s;
            -webkit-transition-timing-function: ease;
            -moz-transition-property: border;
            -moz-transition-duration: .5s;
            -moz-transition-timing-function: ease;
            /*border:transparent solid 1px;*/
        }
</style>
    <body>
        <?php include '../menus/menuUsuario.php'; ?>
            <?php include 'sidebar.php'; ?>
            <div class="content" style="padding-bottom:100px;">
                <div class="header">
                    <h1 class="page-title">Administradores</h1>
                </div>
                
                <?php $datos = datosUsuarioSesion(); ?>
                <?php if ($contactos = obtenerContactos($_SESSION['uid'])) {
                    $i = 0; ?> 
                    
                      <?php  while ($i < count($contactos)) { 
                            $uid = $contactos[$i]['idUsuario'];
                            $nombreDenunciado = $contactos[$i]['nombre']." ".$contactos[$i]['apellidos'];
                            ?>

                        <div class="contenedorNoticiaBlog" <?php if ($contactos[$i]['idPerfil'] == 0) { ?>style='background-color:whitesmoke'<?php } ?>>
                            <div class="contenedorImgBlog" >
                                <img class="imagenBlog thumb" src="../<?php echo $contactos[$i]['foto']; ?>">
                            </div>
                            
                            <div style="float:left;padding-left:5px;">
                                
                                <div class="by">
                                    <b><a href="../usuarios/perfil?uid=<?php echo $contactos[$i]['idUsuario'] ?>"><?php echo $contactos[$i]['nombre']." ".$contactos[$i]['apellidos'] ?></a></b><br>
                                    <?php if($contactos[$i]['idPerfil'] == 0) { ?>
                                        <font style="font-weight:bold;color:#5789ad">Es administrador</font>
                                    <?php } else { ?>
                                        No es administrador</font>
                                    <?php } ?>
                                    
                                </div>
                            </div>
                            <div style="width:50px;color:<?php echo estaBloqueado($contactos[$i]['idUsuario']) ?>;float:left;text-align:center;padding-top:15px;">
                                <i class="glyphicon glyphicon-minus-sign" title="Usuario bloqueado"></i>
                            </div>
                            <div style="float:right;">
                                <?php if($contactos[$i]['idPerfil'] == 1){ ?>
                                    <div class="opcion">
                                        <i class="glyphicon glyphicon-thumbs-down" style="color:silver"></i>
                                    </div>
                                <?php } else { ?>
                                    <div class="opcion">
                                        <i class="glyphicon glyphicon-thumbs-down remove" data-toggle="modal" data-target="#quitarAdmin<?php echo $i ?>" title="Quitar privilegios de Administrador"></i>
                                    </div>
                                <?php } ?>
                                <?php if($contactos[$i]['idPerfil'] == 0){ ?>
                                    <div class="opcion">
                                        <i class="glyphicon glyphicon-thumbs-up"  style="color:silver"></i>
                                    </div>
                                <?php } else { ?>
                                    <div class="opcion">
                                        <i class="glyphicon glyphicon-thumbs-up search" data-toggle="modal" data-target="#darAdmin<?php echo $i ?>" title="Dar privilegios de adminsitrador"></i>
                                    </div>
                                <?php } ?>
                                
                            </div>
                            
                            <div style="clear:both;"></div>
                        </div>
                        <script>
                            $(window).load(function(){
                                $('#darAdmin<?php echo $i ?>').modal(options);
                                $('#quitarAdmin<?php echo $i ?>').modal(options);
                            });
                        </script>

                        <!--VENTANAS MODALES-->
                        <?php include 'ventanaQuitarAdministrador.php'; ?>
                        <?php include 'ventanaHacerAdministrador.php'; ?>
                        
                        <?php $i++;
                        }
                    } else { ?>
                        <div style="text-align:center;padding:10px;">
                            No existen usuarios bloqueados
                        </div>
                    <?php }
                ?>
                        
                <div style="clear:both"></div>
                <div style='position:absolute;bottom:0;width:100%;margin-left:12px;'>
                    <?php include 'footer.php'; ?>
                </div>
            </div>
    </body>
</html>